<template>
  <div class="goods">
    <div class="img">
      <img :src="data.src" alt="" />
    </div>
    <div class="presentation">
      {{ data.presentation }}
    </div>
    <div class="operation">
      <el-button type="primary"> 编 辑 </el-button>
      <el-button type="danger" @click="deleteBtn(data.id)"> 删 除 </el-button>
    </div>
  </div>
</template>

<script>
// import { deleteCompany } from "@/api/api.js";
export default {
  name: "goods",
  props: {
    data: {
      type: Object,
      required: true,
    },
  },
  methods: {
    //   删除
    deleteBtn(id) {
      this.$emit("means", id);
    },
  },
};
</script>

<style>
.goods {
  padding: 15px;
}

.img img {
  width: 300px;
  height: 300px;
  background-color: #fff;
}
.presentation {
  margin-top: 20px;
  width: 300px;
  height: 80px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.operation {
  margin: 20px;
  display: flex;
  justify-content: center;
}
</style>